home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F24822_ShowMin.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-05  |  2.3 KB  |  72 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3.   <xsl:output method="html" indent="yes" />
  4.  
  5.   <xsl:include href="Min.xsl" />
  6.  
  7.   <xsl:template match="/">
  8.     <html>
  9.       <head>
  10.         <title>Stylesheet Example</title>
  11.         <style type="text/css"><![CDATA[
  12.         H1 {COLOR: red; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
  13.         H2 {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  14.         .head {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 14pt;}
  15.         .subhead {COLOR: darkblue; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  16.         .text {COLOR: black; FONT-FAMILY: Arial; FONT-SIZE: 12pt;}
  17.         TH {COLOR: white; FONT-FAMILY: Arial; background-color: darkblue;}
  18.         TD {COLOR: darkblue; FONT-FAMILY: Arial}
  19.         TR { background-color: beige; }
  20.         BODY { background-color: beige; }
  21.         ]]></style>
  22.       </head>
  23.       <body>
  24.         <xsl:apply-templates />
  25.       </body>
  26.     </html>
  27.   </xsl:template>
  28.  
  29.   <xsl:template match="weather">
  30.     <h1>Temperatures for: 01/21/2001 - 01/28/2001</h1>
  31.     <xsl:apply-templates />
  32.   </xsl:template>
  33.  
  34.   <xsl:template match="temperatures">
  35.     <h2>City:
  36.       <xsl:value-of select="@city" />
  37.     </h2>
  38.     <!-- Display Table Headers -->
  39.     <table border="1">
  40.       <tr>
  41.         <th>date</th>
  42.         <th>Temperatue(F)</th>
  43.       </tr>
  44.       <!-- Display each temperature for the city as a row in the table -->
  45.       <xsl:for-each select="temperature">
  46.         <tr>
  47.           <td>
  48.             <xsl:value-of select="@date" />
  49.           </td>
  50.           <td>
  51.             <xsl:value-of select="." />
  52.           </td>
  53.         </tr>
  54.       </xsl:for-each>
  55.     </table>
  56.     <!-- Display Call the "Min" template to determine the
  57.     minimum temperature for the temperature nodes-->
  58.     <xsl:variable name="nMinTemp">
  59.       <xsl:call-template name="Min">
  60.         <xsl:with-param name="list" select=".//temperature" />
  61.         <xsl:with-param name="nMin" select="'99999'" />
  62.       </xsl:call-template>
  63.     </xsl:variable>
  64.  
  65.     <!-- Display the minimum temperature calculated by the Min template-->
  66.     <h3>The lowest temperature is:
  67.       <xsl:value-of select="$nMinTemp" />
  68.     </h3>
  69.  
  70.     <br />
  71.   </xsl:template>
  72. </xsl:stylesheet>